<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::group(['middleware'=>'checkStatus'],function (){
    Route::get('/', function (\Modules\Admin\Entities\Modules $modules) {
        //获取当前后台设置的默认模块的数据
        $module = $modules->getdefaultData();
        $class = '\Modules\\'.$module.'\Http\Controllers\HomeController';
        //访问后台设置的默认模块
        return app()->build($class)->index();
//    return (new $class)->index();
    });
});

//前台展示尚未激活账号的路由
Route::get('/show','UserController@show')->name('show');
//前台展示激活账号的路由
Route::get('/jihuo/{token}','UserController@jihuo')->name('jihuo');
//前台重新发送邮件的路由
Route::get('/sendMail','UserController@sendMail')->name('sendMail');


Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
//上传图片路由
Route::any('/upload','UploadController@upload');
//已经上传路由图片地址
Route::any('/filesLists','UploadController@filesLists');
//编辑器路由
Route::any('/upload-simditor','UploadController@eidtor');

//微信路由
Route::any('/wechat','WechatController@handle')->name('wechat');